#ifndef _ENEMY_H_
#define _ENEMY_H_

#include "vec.hpp"

class Player;
class Weapon;

#include "actor.hpp"

class Enemy : public Actor
{
public:
	class Type;

	class ItemBox;
	class Drifter;
	class Walker;
	class Flyer;
	class Tosser;
	class Rock;

	class Boss1;

	enum TypeN
	{
		NOTYPE = -1,
		IBOX,
		DRIFTER,
		WALKER,
		FLYER,
		TOSSER,
		ROCK,
		BOSS1,
		TYPECT
	};

	bool Vulnerable()
	{
		return stun == 0;
	}

	static int TDamage(int t);
	int Damage()
	{
		return TDamage(typen);
	}

	bool IsBoss()
	{
		return typen >= BOSS1;
	}

	void Wake()
	{
		stun = 0;
	}

	Enemy();
	~Enemy();

	static bool Open();
	static bool TOpen(Cue & cue);
	void Init(float x, float y, Cue & cue);
	void Update();

	void Hit(Player & plr);
	void Hit(Weapon & wpn);
	
	void HUDUpdate();

	void DieSmall();
	void DieLarge();
	int ItemScan();
	void ItemDrop();
	void CueReturn();

	friend class Player;
	friend class Weapon;

private:	
	Type *type;
	int typen;

	int state;

	Vec2f home;

	int stun;
	int dropitem;
};

#include "actor.hpp"
extern ActPool<Enemy, 14> Enmes;

#endif
